#include<stdio.h>
#include<stdlib.h>
#include<sys/stat.h>
#include<unistd.h>
#include<fcntl.h>
#include<ctype.h>
void usage(const char* myn)
{
printf("\n Usage: %s folder\n\n",myn);
exit(1);
}
int main(int argc,char * argv[])
{
int mode;
if(argc<2) usage(argv[0]);
if(argc==2) mode=0777;
else if(sscanf(argv[2],"%o",&mode)==0)
{
printf("%s Invalid mode.\n",argv[0]);
exit(1);
}
if(mkdir(argv[1],mode)==-1) perror(argv[0]);

}

